package com.broada.apm.dao.impl;

import java.util.List;

import com.broada.apm.dao.IPLocationDao;
import com.broada.apm.model.IPLocation;

public class MysqlIPLocationDao extends MysqlAbstractDao implements IPLocationDao {

	public static final String IPLOCATION_NAMESPACE = "com.broada.apm.dao.IPLocationDao.";
	
	@Override
	public void addIPLocation(IPLocation ipLocation) {
		getSqlSession().insert(IPLOCATION_NAMESPACE + "addIPLocation", ipLocation);
	}

	@Override
	public void updateIPLocation(IPLocation ipLocation) {
		getSqlSession().update(IPLOCATION_NAMESPACE + "updateIPLocation", ipLocation);
	}

	@Override
	public void deleteIPLocation(IPLocation ipLocation) {
		getSqlSession().delete(IPLOCATION_NAMESPACE + "deleteIPLocation", ipLocation);
	}

	@Override
	public List<IPLocation> getAllIPLocations() {
		return getSqlSession().selectList(IPLOCATION_NAMESPACE + "getAllIPLocations");
	}

	@Override
	public List<IPLocation> getIPLocation(IPLocation ipLocation) {
		return getSqlSession().selectList(IPLOCATION_NAMESPACE + "getIPLocation", ipLocation);
	}

	@Override
	public List<IPLocation> getAllDictIpLocations() {
		return getSqlSession().selectList(IPLOCATION_NAMESPACE + "getAllDictIpLocations");
	}

	@Override
	public List<IPLocation> getIPLocationByCondition(IPLocation ipLocation) {
		return getSqlSession().selectList(IPLOCATION_NAMESPACE + "getIPLocationByCondition", ipLocation);
	}

}
